<template>
    <div class="nologin">
        <button @click="signout">退出登录</button>
        <img src="../../assets/imgs/headimg1.jpg" />
    </div>
</template>

<script>
import { useRouter } from 'vue-router';

export default {
  name: 'Nologin',
  setup() {
    const router = useRouter();
    function signout() {
      // 清除token值
      window.sessionStorage.removeItem('token');
      // 跳转到登录页面
      router.replace('/loginview');
    }
    return {
      signout,
    };
  },
};
</script>

<style scoped>
    .nologin{
        margin-top: 30px;
    }
    button{
        width: 100px;
        height: 30px;
        background-color: #00FF00;
        color: #ffffff;
        border-radius: 5px;
        border: none;
    }
</style>
